<template>
	<view>
		<view class="goods-item">
			<!-- 帖子的标题 -->
			<view class="title u-line-1 u-skeleton-rect">
				{{todoData.title}}
			</view>
			
			<!-- 帖子的内容 -->
			<view class="content">
				{{todoData.content}}
			</view>
			
			<!-- 帖子的功能区(赞、评论等) -->
			<u-row class="lastline">
				<u-col :span="4" >
					<view class="card-like name-card-item" @click="clickLike">
						<u-icon name="thumb-up" size="40"/>
						<view class="like">点赞</view>
					</view>
				</u-col>
				
				<u-col :span="4" >
					<view class="card-comment name-card-item" @click="clickComment">
						<u-icon name="chat" size="40"/>
						<view class="comment">评论</view>
					</view>
				</u-col>
				
				<u-col :span="4" >
					<view class="card-share name-card-item" @click="clickShare">
						<u-icon name="share" size="40"/>
						<view class="share">分享</view>
					</view>
				</u-col>
				
			</u-row>
			
		</view>
		
	</view>
</template>

<script>
	export default {
		name:"card",
		props:{
			todoData: {
			    type: Object,
			    default () {
			      return {}
			    }
			}
		},
		data() {
			return {
				
			};
		},
		methods: {
			
			// 用户点击了点赞
			clickLike(){
				this.$u.toast("点赞功能未实现")
			},
			
			// 用户点击了评论
			clickComment(){
				this.$u.toast("评论功能未实现")
			},
			
			// 用户点击了分享
			clickShare(){
				this.$u.toast("分享功能未实现")
			},
			
			
			
		}
	}
</script>

<style lang="scss" scoped>
	.goods-item {
		padding: 20rpx;
		margin-bottom: 20rpx;
		box-shadow: 0 12rpx 20rpx rgba(0, 0, 0, .1);

		// 标题
		.title {
			font-size: 32rpx;
			font-weight: bold;
			margin-top: 20rpx;
			margin-bottom: 20rpx;
			width: 100%;
			text-align: center;
		}
		
		// 内容
		.content {
			margin: 30rpx 0;
		}
		
		// 评论、点赞等功能区
		.lastline{
			margin-top: 30rpx;
		}

		// 点赞
		.like {
			// width: 40%;
			color: #888;
			margin-left: 10rpx;
		}
		
		// 评论
		.comment {
			// width: 40%;
			color: #888;
			margin-left: 10rpx;
		}
		
		// 分享
		.share{
			color: #888;
			margin-left: 10rpx;
		}
		
		.name-card-item{
			display: flex;
			align-items: center;
			justify-content: center;
		}
		
	}
</style>
